<template>
    <div>
        <!-- 两面盘 -->
        <GdklsfTwoface @betdataObj="betdataObj" :betmoney="betmoneys" :ninetime="ninetime" :resetinp="resetinps" :openBet="openBets" v-if="levelid == 1" />
        <!-- 第几球 -->
        <GdklsfBall @betdataObj="betdataObj" :betmoney="betmoneys" :ninetime="ninetime" :resetinp="resetinps" :openBet="openBets" v-if="levelid == 2 || levelid == 3 || levelid == 4 || levelid == 5 || levelid == 6 || levelid == 7 || levelid == 8 || levelid == 9" />
        <!-- 正码 -->
        <GdklsfPositive @betdataObj="betdataObj" :betmoney="betmoneys" :ninetime="ninetime" :resetinp="resetinps" :openBet="openBets" v-if="levelid == 10" />
        <!-- 连码 -->
        <GdklsfContinuous @betdataObj="betdataObj" @contBetFun="contBet" :ninetime="ninetime" :betmoney="betmoneys" :resetinp="resetinps" :openBet="openBets" v-if="levelid == 11" />
    </div>
    
    
</template>
<script>

    export default {
        name: "Gdklsfgame",
        props: {  //普通类型：String、Number、Boolean、Null    引用类型： Array、Object
            betmoney: {   //   下注金额
                type: String,
                required: true
            },
            resetinp: {   //   是否重填已下注金额  0为未下注  其他为已下注
                type: Number,
                required: true
            },
            openBet: {  //开奖  可下注
                type: Boolean,
                required: true
            },
            ninetime: {  //90s
                type: Number,
                required: true
            },
        },
        data(){
            return{
                levelid: 0,  //二级菜单id
                betmoneys: '',  //下注金额
                resetinps: 0,  //是否重填已下注  0为未下注  其他为已下注
                openBets: false,  //开奖
            }
        },
        methods: {
            init(){
                this.levelid = this.$route.query.levelid;
            },
            betdataObj(data){
                // console.log('---------------------gdklsfgame',data);
                this.$emit('betdataObj',data)
            },
            //连码  
            contBet(obj){
                console.log(obj);
                this.$emit('contBetObj',obj);
            },
            
        },
        mounted(){
            this.init();
        },
        watch :{
            betmoney(now,old){
                this.betmoneys = now;
            },
            resetinp(now,old){
                this.resetinps = now;
            },
            openBet(now,old){
                console.log('-----gdklsfgame-----openBet',now);
                this.openBets = now;
                
            }
        },
    }
</script>
